package models

import "gin-demo/pkg/setting"

type CaseLabelLog struct {
	Model
	CaseId        int64  `gorm:"column:case_id; size:10; not null; default:0; " json:"case_id"`                   // 病例ID
	SerialNumber  string `gorm:"column:serial_number; size:50; not null; default:''; " json:"serial_number"`      // 设备编号
	CaseLabelId   string `gorm:"column:case_label_id; size:10; not null; default:'0'; " json:"case_label_id"`     // 病例标签ID
	CaseLabelName string `gorm:"column:case_label_name; size:50; not null; default:'0'; " json:"case_label_name"` // 病例标签名称
	Params        string `gorm:"column:params; size:255; not null; default:''; " json:"params"`                   // 参数
	OldData       string `gorm:"column:old_data; size:255; not null; default:''; " json:"old_data"`               // 旧数据
	LabelType     int32  `gorm:"column:label_type; size:4; not null; default:'0'; " json:"label_type"`            // 标签类型
	Type          int32  `gorm:"column:type; size:4; not null; default:'0'; " json:"type"`                        // 标签日志类型
	UserId        string `gorm:"column:user_id; size:10; not null; default:'0'; " json:"user_id"`                 // 用户名
	Remark        string `gorm:"column:remark; size:255; not null; default:''; " json:"remark"`                   // 备注
}

func (m *CaseLabelLog) TableName() string {
	return setting.DatabaseSetting.TablePrefix + "case_label_log"
}

const LABEL_TYPE_SYSTEM int32 = 2      //系统标签
const LABEL_TYPE_CUSTOM int32 = 1      // 用户自定义标签
const LABEL_TYPE_AI int32 = 3          // AI标签
const LABEL_LOG_TYPE_ADD int32 = 1     // 添加
const LABEL_LOG_TYPE_EDIT int32 = 2    // 编辑
const LABEL_LOG_TYPE_DELETE int32 = 3  // 删除
const LABEL_LOG_TYPE_REPLACE int32 = 4 // 替换

var LABEL_TYPE_MSG = map[int32]string{
	LABEL_TYPE_SYSTEM: "系统标签",
	LABEL_TYPE_CUSTOM: "用户自定义标签",
	LABEL_TYPE_AI:     "AI标签",
}

var LABEL_LOG_TYPE_MSG = map[int32]string{
	LABEL_LOG_TYPE_ADD:     "添加",
	LABEL_LOG_TYPE_EDIT:    "编辑",
	LABEL_LOG_TYPE_DELETE:  "删除",
	LABEL_LOG_TYPE_REPLACE: "替换",
}
